<?php
	include_once '../config.php';
	include_once '../utilities.php';

	$taskLang = "";

	if (isset($_GET['lang']))
	{
		$taskLang = $_GET['lang'];
	}
	
	if (isset($_FILES["file"]))
	{
		if ($_FILES["file"]["error"] > 0)
		{
			echo "Error: " . $_FILES["file"]["error"] . "<br />";
		}
		else
		{
			$path = "../" . __PRODUCTS_WIDGET_PATH__ . $taskLang . "/";
			uploadFile($_FILES["file"]["name"], $_FILES["file"]["tmp_name"], $path, $taskLang, __DB_PRODUCTS_WIDGET__);
		}
	}
?>

Choose language:
<a href="index.php?task=<?php echo $currTask; ?>&lang=en">EN</a>
<a href="index.php?task=<?php echo $currTask; ?>&lang=fr">FR</a>

<?php
	if ($taskLang == "")
	{
		exit(0);	
	} 
?>

<hr/>

<h3>Upload a products widget for "<?php echo $taskLang; ?>"</h3>

<div id="widgetUpload">
	<form action="<?php echo "index.php?task=". $currTask . "&lang=" . $taskLang ?>" method="post" enctype="multipart/form-data">
		<label for="file">Widget:</label>
		<input type="file" name="file" id="file" />
		<br />
		<input type="submit" name="submit" value="Submit" />
	</form>
</div>